import http from '../utils/http.js';

export function createOrder(addressBookId, text, time, remark, address, consignee, phone) {
    return http.post('/user/order/create', {
        addressBookId: addressBookId,
        text: text,
        time: time,
        remark: remark,
        address: address,
        consignee: consignee,
        phone: phone
    })
}
export function getOrderByOrderId(id) {
    return http.get(`/user/order/getOne/${id}`)

}
export function cancelOrder(id) {
    return http.post(`/user/order/overtimeCancel/${id}`)
}
export function orderListByUserId() {
    return http.get('/user/order/list/')
}
export function paySuccess(id, payMethod) {
    return http.post(`/user/order/paySuccess/${id}/${payMethod}`)
}
export function userCancelOrder(id,cancelReason) {
    return http.post(`/user/order/userCancel/${id}/${cancelReason}`)
}